ifeq ($(OS),Windows_NT)
	LEAP_LIB = -lLeapC
else
	LEAP_LIB = -lLeap
endif

LIBS = -L/usr/lib $(LEAP_LIB) -lopencv_core -lsfml-system -lsfml-window -lsfml-graphics

CC = c++
FLAGS = -Wall -O2 -g -Iinclude -mwin32
TARGET = leaptricks

objects/%.o: source/%.cpp
	$(CC) $(FLAGS) -o $@ -c $< $(LIBS)

$(TARGET): $(subst source,objects,$(patsubst %.cpp,%.o,$(wildcard source/*.cpp)))
	$(CC) $(FLAGS) -o $@ $^ $(LIBS)
